package com.ruoyi.web.controller.app.controller;

import com.ruoyi.framework.web.exception.base.XResult;
import com.ruoyi.web.controller.app.service.AppChangeService;
import com.ruoyi.web.core.base.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import javafx.geometry.Pos;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("app/change")
@Api(tags = "提现接口")
public class AppChangeController{

    @Autowired
    private AppChangeService appChangeService;

    @RequestMapping(value = "withdraw",method = RequestMethod.POST)
    @ApiOperation(value = "提现")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "memberId", value = "用户id", required = true, dataType = "Long", paramType = "query"),
            @ApiImplicitParam(name = "bankCardNum", value = "银行卡号", required = true, dataType = "String", paramType = "query    "),
            @ApiImplicitParam(name = "money", value = "提现金额",required = true, dataType = "Double", paramType = "query")
    })
    public XResult withDraw(Long memberId, String bankCardNum, Double money) {
        return new XResult("操作成功",appChangeService.withDraw(memberId,bankCardNum,money));
    }
}
